#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    : 2023/11/15 23:38
# @function: the script is used to do something.
# @version : 

import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
                  'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36'
}

# 常用方法 问号后面是请求参数
# url = 'https://www.baidu.com/s?wd=python'
#
# response = requests.get(url, headers=headers).content
# print(response.decode())


# 通过字典进行关键字传递
url = 'https://www.baidu.com/s'
kw = {
    'wd': 'python'
}

response = requests.get(url, headers=headers, params=kw)
print(response.content.decode())

